﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ETL.Entity;

namespace ETL.DataAccess
{
    public class ProjectLogRepository
    {
        public int AddProjectLog(string username, short? projectId, short? categoryId, short? taskId, string detail)
        {
            var db = new ETLDataEntities();
            var newLog = new project_log();

            newLog.log_name = username;
            newLog.log_date = DateTime.Now;
            newLog.log_details = detail;
            newLog.log_project = projectId;
            newLog.log_category = categoryId;
            newLog.log_task = taskId;

            db.project_log.Add(newLog);

            int i = db.SaveChanges();
            return i;
        }
    }
}
